<% const dayJs=require('dayjs'); const {version}=require('./package.json'); const NODE_ENV=process.env.NODE_ENV; const
  isProd=NODE_ENV==='production' ; const isDevelopment=NODE_ENV==='development' ; const TITLE=process.env.TITLE; const
  KEYWORDS=process.env.KEYWORDS; const DESCRIPTION=process.env.DESCRIPTION; %>
  <!DOCTYPE html>
  <html>

  <head>
    <!-- 构建信息 -->
    <meta build-time="<%= dayJs().format('YYYY-MM-DD HH:mm:ss') %>" build-env="<%= NODE_ENV %>"
      build-version="<%= version %>">
    <!-- 设置字符集格式 -->
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <!-- 设置网站标题 -->
    <title>
      <%= TITLE %>
    </title>
    <!-- 设置关键字 -->
    <meta name="keywords" content="<%= KEYWORDS %>" data-react-helmet="true" />
    <!-- 设置描述 -->
    <meta name="description" content="<%= DESCRIPTION %>" data-react-helmet="true" />
    <!-- 启用360浏览器的极速模式(webkit) -->
    <meta name="renderer" content="webkit">
    <!-- 避免IE使用兼容模式 -->
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
    <!-- 网页不会被缓存 -->
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-cache">
    <meta http-equiv="Expires" content="0">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <!-- 忽略页面中的数字识别为电话号码、email识别 -->
    <meta name="format-detection" content="telephone=no, email=no">
    <!-- 以下为openinstall集成代码，建议在html文档中尽量靠前放置，加快初始化过程 -->
    <!-- 强烈建议直接引用下面的cdn加速链接，以得到最及时的更新，我们将持续跟踪各种主流浏览器的变化，提供最好的服务；不推荐将此js文件下载到自己的服务器-->
    <script type="text/javascript" charset="UTF-8" src="//web.cdn.openinstall.io/openinstall.js"></script>
    <% if(isProd) { %>
      <script>
        //百度统计
        var _hmt = _hmt || [];
        (function () {
          var hm = document.createElement("script");
          hm.src = "https://hm.baidu.com/hm.js?a7d596339245244bcf96c602c14e6e89";
          var s = document.getElementsByTagName("script")[0];
          s.parentNode.insertBefore(hm, s);
        })();
      </script>
      <script type="text/javascript">
        //线上去掉react dev tools
        if ('__REACT_DEVTOOLS_GLOBAL_HOOK__' in window) {
          window.__REACT_DEVTOOLS_GLOBAL_HOOK__.inject = function () {
          };
        }
        if ('__REDUX_DEVTOOLS_EXTENSION_COMPOSE__' in window) {
          window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ = function () {
          };
        }
        //解决 https调用 http
        var protocol = window.location.protocol;
        if (protocol.includes("https:")) {
          var metaTag = document.createElement("meta");
          metaTag.httpEquiv = "Content-Security-Policy";
          metaTag.content = "upgrade-insecure-requests";
          document.head.appendChild(metaTag);
        }
        // cnzz 统计
        (function () {
          var hm = document.createElement('script');
          hm.src = '//s9.cnzz.com/z_stat.php?id=1280511658&web_id=1280511658';
          var s = document.getElementsByTagName('script')[0];
          s.parentNode.insertBefore(hm, s);
        }());
      </script>
      <% } else if (isDevelopment) { %>
        <script src="https://cdn.jsdelivr.net/npm/vconsole@latest/dist/vconsole.min.js"></script>
        <script type="text/javascript">
          // init vConsole
          new VConsole();
        </script>
        <% } %>
  </head>

  <body>
    <div id="app-main"></div>
  </body>

  </html>